package com.smedi.ismedi.progress.core.domain.aggregatemodel;

import lombok.*;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 本月施工计划与完成情况
 *
 * @author liaojiajie
 * @date 2022/09/16
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class EngineeringConstructionCompletionExport {
    /**
     * 主表id
     */
    private Long	id;
    /**
     * 关联工程报告主表id
     */
    private Long	engineeringWeekMonthReportId;
    /**
     * 一级任务名称
     */
    private String oneTaskName;
    /**
     * 任务名称前缀（序号）
     */
    private String namePrefix;
    /**
     * 计划开始时间
     */
    private String scheduleStartTime;
    /**
     * 计划完成时间
     */
    private String scheduleEndTime;
    /**
     * 实际开始时间
     */
    private String realStartTime;
    /**
     * 实际完成时间
     */
    private String realEndTime;

    public void setScheduleEndTime(LocalDateTime scheduleEndTime) {
        if (scheduleEndTime != null) {
            this.scheduleEndTime = scheduleEndTime.getYear() + "年" + scheduleEndTime.getMonthValue() + "月" + scheduleEndTime.getDayOfMonth() + "日";
        }
    }

    public void setRealEndTime(LocalDateTime realEndTime) {
        if (realEndTime != null) {
            this.realEndTime = realEndTime.getYear() + "年" + realEndTime.getMonthValue() + "月" + realEndTime.getDayOfMonth() + "日";
        }
    }
    public void setScheduleStartTime(LocalDateTime scheduleStartTime) {
        if (scheduleEndTime != null) {
            this.scheduleStartTime = scheduleStartTime.getYear() + "年" + scheduleStartTime.getMonthValue() + "月" + scheduleStartTime.getDayOfMonth() + "日";
        }
    }

    public void setRealStartTime(LocalDateTime realStartTime) {
        if (realStartTime != null) {
            this.realStartTime = realStartTime.getYear() + "年" + realStartTime.getMonthValue() + "月" + realStartTime.getDayOfMonth() + "日";
        }
    }
    /**
     * 进度状态(0、滞后  1、正常)
     */
    private String status;

    public void setStatus(Long status) {
        if (status == 0){
            this.status = "滞后";
        }else {
            this.status = "正常";
        }
    }

    /**
     * 滞后时长
     */
    private String lagTime;

    public void setLagTime(Long lagTime) {
        if (lagTime != null) {
            this.lagTime = lagTime + "天";
        }
    }

    /**
     * 完成百分比
     */
    private String percentage;

    public void setPercentage(String percentage) {
        this.percentage = percentage+"%";
    }

//    /**
//     * 照片名称
//     */
//    private String photo;
    /**
     * 进度照片
     */
    private List<ProgressFile> progressPhotos;



}